<% form_remote_tag :url => {:controller => 'taggings', :action => 'create', :person_id => @person} do %>

<% @tag_groups = TagGroup.find(:all) %>

<span id="tag-groups" class="cell">
	<label>Tag Group</label><br>
	<%= collection_select('tag_group', 'id', @tag_groups.sort_by(&:name), 'id', 'name', {:prompt => "Select Tag Group"}) %>
</span>

<%= observe_field 'tag_group_id',
				 :url => {:controller => 'people', :action => 'tag_group_changed'},
 				 :update => 'tag_names',
				 :with => 'id' %>

<span id="tag-names" class="cell">
	<%= render :partial => "people/select_tag", :locals => {:tag_group => @tag_group ||= @tag_groups[0]} %>
</span>

<span class="cell">
	<label>Start Date</label><br>
	<%= date_field 'tagging', 'start_date', :format => '%m/%d/%Y', :size => 12 %>
</span>

<span class="cell">
	<label>End Date</label><br>
	<%= date_field 'tagging', 'end_date', :format => '%m/%d/%Y', :size => 12 %>
</span>

<br>

<div style="float:none;clear:both">
	<label>Comments</label><br>
	<%= text_area 'tagging', 'comments', :rows => 2, :cols => 40 %>
</div>

	<%= submit_tag "Add Tag" %>
<% end %>